package com.richpay.basejava.base15;

/**
 * 异常处理
 */
public class ExceptionDel {
    public static void main(String[] args) {
        int result = cal(5, 0);
        System.out.println("result=" + result);
    }

    static int cal(int num1, int num2) {
        int result = 0;
        int i = 5;
        try {
            result = num1 / num2;

        } catch (Exception e) {
            e.printStackTrace();
            System.exit(0);//JVM退出，剩余的代码都不执行了。
            return i;//
        } finally {
            i = 100;
            System.out.println("======finally=====");
            return 100;
        }


//        return result;
    }
}
